package com.lin.generator.service;

import com.lin.generator.mapper.MysqlMapper;
import com.lin.generator.model.Field;
import com.lin.generator.model.Table;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * mysql服务
 *
 * @author 猴哥
 */
@Service
public class MysqlService extends AbstractService {
	@Resource
	private MysqlMapper mapper;

	/**
	 * 获取表信息
	 *
	 * @param dbName 数据库名
	 * @return 表信息
	 */
	@Override
	public List<Table> getTables(String dbName) {
		return mapper.getTables(dbName);
	}

	/**
	 * 获取字段信息
	 *
	 * @param dbName 数据库名
	 * @param tableName 表名
	 * @return 字段信息
	 */
	@Override
	public List<Field> getFields(String dbName, String tableName) {
		return mapper.getFields(dbName, tableName);
	}
}
